﻿using FoodModel;
using J.FoodManageGet.Application.Command.VegetablesCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.VegetablesCommand
{
    public class VegetablesShowCommandHandler : IRequestHandler<VegetablesShowCommand, List<Vegetables>>
    {
        private readonly IVegetablesRepository vegetablesRepository;

        public VegetablesShowCommandHandler(IVegetablesRepository vegetablesRepository)
        {
            this.vegetablesRepository = vegetablesRepository;
        }
        public async Task<List<Vegetables>> Handle(VegetablesShowCommand request, CancellationToken cancellationToken)
        {
            return await vegetablesRepository.VegetablesShow();

        }
    }
}
